<?php include_partial('global/flash') ?>
<?php include_partial('global/navbar') ?>
<div class="next_head">
</div>
<div class="next_head">
    <div class="wrap">
        <a href="#" class="on">还款中</a>
        <a href="<?php echo url_for('account/published')?>">已发布</a>
    </div>
</div>

<div class="content_nav">
        <?php if($pager->getNbResults()):?>
        <div class="tag_nav wrap">
            <h4>还款中的借款列表</h4>
            <hr/>
            <?php foreach($pager->getResults() as $k=>$result): ?>
                <div class=" pd-n">
                    <table class="table">
                        <thead>
                            <tr>
                                <th colspan="6">

                        <div class="ft-l"><a href="<?php echo url_for('project/index?id='.$result->getId())?>" title="<?php echo $result->getTitle();?>"><?php echo $result->getTitle();?></a> （下次还款时间：<?php echo date("Y-m-d",strtotime($result->getLastRetrenTime()));?>）</div>
                                    <div class="ft-r"><a href="<?php echo url_for('account/repayment?id='.$result->getId())?>">还款</a></div>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="100"><span class="tit-p">借款金额：</span></td>
                                <td width="160"><span class="alt-p"><?php echo number_format($result->getMoney(),2)?></span></td>
                                <td width="100"><span class="tit-p">年利率：</span></td>

                                <td width="160"><span class="alt-p"><?php echo round($result->getMoneyRate(),2)?>%</span></td>
                                <td width="100"><span class="tit-p">期限：</span></td>
                                <td width="160"><span class="alt-p"><?php echo $result->getTermNum()?><?php if($result->getIsDay() == 0):?>月<?php else:?>天<?php endif;?></span></td>
                            </tr>
                            <tr>
                                <td><span class="tit-p">应付本息：</span></td>
                                <td><span class="alt-p"><?php echo number_format(bcadd($result->getInterestSum(),$result->getMoney(),sfConfig::get('app_value_bit')),2);?></span></td>
                                <td><span class="tit-p">已付本息：</span></td>
                                <td><span class="alt-p"><?php echo $result->getPrincipal(1)?></span></td>
                                <td><span class="tit-p">待还本息：</span></td>
                                <td><span class="alt-p"><?php echo $result->getPrincipal(0)?></span></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <hr class="dashed" />
    <?php endforeach;?>

            <?php $uri = url_for("account/myloan")?>
            <ul class="pagination pagination-lg ft-r">
            <?php echo pager_navigation($pager, $uri); ?>
            </ul>

        </div>
    <?php else:?>
         <div class="tag_nav wrap">
            <div class="nodata">
                您没有 还款中 的借款列表
            </div>
        </div>
    <?php endif;?>

</div>
<script >
    $("#10003,#10009").addClass("on");
</script>
